package cn.how2j.basics.charactor;

/**
 * Created by SilentJhin on 2020/8/18 18:53
 */
public class Hero {
    public String name;
    public float hp;
    public int damage;
    static String copyright;

    static {
        copyright = "copyright is owned by Riot Games";
    }

    public Hero(String name) {
        this.name = name;
    }
    public Hero(String name, float hp, int damage){
        this.name = name;
        this.hp = hp;
        this.damage = damage;
    }

    public Hero() {

    }

    public int compareTo(Hero anotherHero){
        if (this.damage < anotherHero.damage) {
            return 1;
        } else {
            return -1;
        }
    }

    public String getName() {
        return name;
    }
    public void showName(String name1) {
        this.name = name1;
        System.out.println(this.name);
    }

    public void showName(String name1, int i) {
        this.name = name1;
        System.out.println(this.name);
        System.out.println(i);
    }

    public boolean matched(){
        return false;
    }

    @Override
    public String toString() {
        return "Hero{" +
                "name='" + name + '\'' +
                ", hp=" + hp +
                ", damage=" + damage +
                '}';
    }
}
